package com.naodong.shenluntiku.mvp.model;

import com.naodong.shenluntiku.mvp.contract.StudySetContract;
import com.naodong.shenluntiku.mvp.model.bean.BaseBean;
import com.naodong.shenluntiku.mvp.model.bean.StudySet;
import com.naodong.shenluntiku.mvp.model.data.api.CommonApi;

import javax.inject.Inject;

import io.reactivex.Observable;
import me.shingohu.man.di.scope.ActivityScope;
import me.shingohu.man.intergation.IRepositoryManager;
import me.shingohu.man.intergation.retrofit.NoBodyEntity;
import me.shingohu.man.mvp.BaseModel;

/**
 * Created by Administrator on 2017/5/30.
 */

@ActivityScope
public class StudySetModel extends BaseModel implements StudySetContract.Model {
    @Inject
    public StudySetModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);
    }

    @Override
    public Observable<BaseBean<StudySet>> getStudySet() {
        return mRespositoryManager.obtainRetrofitService(CommonApi.class).getStudySet();
    }

    @Override
    public Observable<NoBodyEntity> updateStudySet(String type, int isChosen, String value) {
        return  mRespositoryManager.obtainRetrofitService(CommonApi.class).updateStudySet(type, isChosen, value);
    }
}
